package com.yq.socket1.day1.v1;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/07/01 09:36
 */
public class Client {
    public static void main(String[] args) throws IOException {
        //    创建客户端的socket
        Socket socket = new Socket("127.0.0.1", 8888);
        //    从socket中获取输入输出流
        OutputStream out = socket.getOutputStream();

        //    利用输入输出流进行读写操作
        out.write("hello".getBytes());
        out.close();
        //    close
        // socket.close();
    }
}
